home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_REVERSE_ASSIGNMENT
-
- creation {ANY}
- make
-
- feature {ANY}
-
- string: STRING;
- animal: ANIMAL;
- cat: CAT;
- dog: DOG;
- any: ANY;
-
- array_integer: ARRAY[INTEGER];
- array_any: ARRAY[ANY];
-
- make is
- do
- any := "foo";
- is_true(any /= Void);
- string ?= any;
- is_true(string /= Void);
- is_true(any = string);
-
- cat ?= any;
- is_true(cat = Void);
-
- any := 3;
- string ?= any;
- is_true(string = Void);
-
- !!cat;
- any := cat;
- is_true(cat = any);
- dog ?= any;
- is_true(dog = Void);
- cat ?= any;
- is_true(cat = any);
- animal := cat;
- cat ?= animal;
- is_true(cat = animal);
- animal := Void;
- cat ?= animal;
- is_true(cat = Void);
- end;
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_REVERSE_ASSIGNMENT: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- -- std_output.put_string("Yes %N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_REVERSE_ASSIGNMENT
-